<?php
    include_once ("MySql.php");
    include_once ("../entity/Login.php");
    include_once ("../entity/Usuarios.php");

    class LoginDA extends dal{
        public function LoginDA(){
            parent::dal();
        }
        public function validarLogin($entity){
            $sql = "CALL SGISS_USUARIO('$entity->user','$entity->pass')";
            $result =  parent::execute($sql);
            
            while($fila =  mysqli_fetch_object($result)){
                $obj = new Usuarios();
                $obj->ID_USUARIO = $fila->ID_USUARIO;
                $obj->LOGIN = $fila->LOGIN;
                $obj->PASS = $fila->PASS;
                $obj->CARGO = $fila->CARGO;
                $obj->ESTADO = $fila->ESTADO;
            }
            return $obj;
        }
    }
?>
